from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait

from app.page_object.base_page import BasePage


class HomePage(BasePage):
    __BTN_CONTACT = (AppiumBy.XPATH, '//*[@text="通讯录"]')
    #进入到通讯录页面
    def go_to_adressbook(self):
        self.wait_element_until_visible(self.__BTN_CONTACT)
        self.do_find(self.__BTN_CONTACT).click()
        WebDriverWait(self.driver, 20).until(expected_conditions.element_to_be_clickable(self.__BTN_CONTACT))
        # self.driver.find_element(AppiumBy.XPATH, '//*[@text="通讯录"]').click()
        from app.page_object.member_list_page import MemberListPage
        return MemberListPage(self.driver)

